﻿using System;
using System.Collections.Generic;

using System.Text;
using Xeno.Physics;

namespace Xeno.Core
{
    public class XenoGraph
    {

        public string Name { get; set; }
        public XenoNode RootNode { get; private set; }
       
        public XenoGraph()
        {
            
            Name = "XenoGraph";
            RootNode = new XenoNode("Scene_Root");
            RootNode.GraphOwner = this;
            ResetRoot();

        }

        public XenoGraph(string name)
        {
        
            Name = name;
            RootNode = new XenoNode(name+"_Scene_Root");
            RootNode.GraphOwner = this;
            ResetRoot();

        }

        public void ResetRoot()
        {
            XenoNode node = new XenoNode(Name+"_GraphPhysicsManager",RootNode);
            node.AddModule = new XenoPhysicsManager(node.Name);
        }
        public void UpdateGraph()
        {
            RootNode.PerformUpdate();
        }
        public void RenderGraph()
        {
            RootNode.PerformRender();
        }

    }
}
